import request from '@/utils/request'
/**
 * 获取公司信息
 */
export function getCompanyInfo() {
  return request({
    url: '/company/department'
  })
}

export function removeCompanys(id) {
  return request({
    method: 'DELETE',
    url: '/company/department/' + id
  })
}

/**
 * 新增部门
 * @param {Object} data {code,introduce,manager,name,pid}
 */
export function addDepartments(data) {
  return request({
    method: 'POST',
    url: '/company/department',
    data
  })
}

/**
 * 根据ID修改部门详情
 * @param {*} id 部门ID
 */
export function getDepartmentsById(id) {
  return request({
    method: 'GET',
    url: '/company/department/' + id
  })
}

/**
 *根据ID修改部门详情
 * @param {Object} data
 */
export function editDepartmentsById(data) {
  return request({
    method: 'PUT',
    url: '/company/department/' + data.id,
    data
  })
}
